

<!DOCTYPE html>
<html lang="zh-CN" data-default-color-scheme=auto>



<head>
  <meta charset="UTF-8">
  <link rel="apple-touch-icon" sizes="76x76" href="/img/fluid.png">
  <link rel="icon" href="/img/fluid.png">
  <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=5.0, shrink-to-fit=no">
  <meta http-equiv="x-ua-compatible" content="ie=edge">
  
  <meta name="theme-color" content="#2f4154">
  <meta name="author" content="John Doe">
  <meta name="keywords" content="">
  
    <meta name="description" content="祝大家2022新年快乐!@[toc] 历史记录  Web项目实战 | 购物系统v2.0 | 开发记录（一）需求分析 | 技术选型 | 系统设计 | 数据表设计 | SpringBoot、SSM、Thymeleaf、Bootstrap…  Web项目实战 | 购物系统v2.0 | 开发记录（二）搭建SpringBoot+SSM框架环境 | 配置Druid+MyBatis | 基于Bootstrap实">
<meta property="og:type" content="article">
<meta property="og:title" content="Web项目实战 _ 购物系统v2.0 _ 开发记录（三）分页显示 _ 根据商品名称进行模糊查询">
<meta property="og:url" content="http://example.com/2022/01/31/Web%E9%A1%B9%E7%9B%AE%E5%AE%9E%E6%88%98%20_%20%E8%B4%AD%E7%89%A9%E7%B3%BB%E7%BB%9Fv2.0%20_%20%E5%BC%80%E5%8F%91%E8%AE%B0%E5%BD%95%EF%BC%88%E4%B8%89%EF%BC%89%E5%88%86%E9%A1%B5%E6%98%BE%E7%A4%BA%20_%20%E6%A0%B9%E6%8D%AE%E5%95%86%E5%93%81%E5%90%8D%E7%A7%B0%E8%BF%9B%E8%A1%8C%E6%A8%A1%E7%B3%8A%E6%9F%A5%E8%AF%A2/index.html">
<meta property="og:site_name" content="Hexo">
<meta property="og:description" content="祝大家2022新年快乐!@[toc] 历史记录  Web项目实战 | 购物系统v2.0 | 开发记录（一）需求分析 | 技术选型 | 系统设计 | 数据表设计 | SpringBoot、SSM、Thymeleaf、Bootstrap…  Web项目实战 | 购物系统v2.0 | 开发记录（二）搭建SpringBoot+SSM框架环境 | 配置Druid+MyBatis | 基于Bootstrap实">
<meta property="og:locale" content="zh_CN">
<meta property="og:image" content="https://img-blog.csdnimg.cn/ebecdac8cbcc49c3a0f6039e1ebd5b0a.png">
<meta property="og:image" content="https://img-blog.csdnimg.cn/af5582e39f7d433da82414e66732d85f.png">
<meta property="og:image" content="https://img-blog.csdnimg.cn/27e84fd0fee744f59c63c82d96251f50.png">
<meta property="og:image" content="https://img-blog.csdnimg.cn/7c53bd82d0374c3fafaf43f060470793.png">
<meta property="og:image" content="https://img-blog.csdnimg.cn/6909ccec8fb049f58b8b3114db09c6c7.png">
<meta property="article:published_time" content="2022-01-31T15:28:14.000Z">
<meta property="article:modified_time" content="2022-08-22T15:50:53.901Z">
<meta property="article:author" content="John Doe">
<meta property="article:tag" content="JavaWeb">
<meta property="article:tag" content="项目实战:购物系统v2.0">
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:image" content="https://img-blog.csdnimg.cn/ebecdac8cbcc49c3a0f6039e1ebd5b0a.png">
  
  
  
  <title>Web项目实战 _ 购物系统v2.0 _ 开发记录（三）分页显示 _ 根据商品名称进行模糊查询 - Hexo</title>

  <link  rel="stylesheet" href="https://lib.baomitu.com/twitter-bootstrap/4.6.1/css/bootstrap.min.css" />



  <link  rel="stylesheet" href="https://lib.baomitu.com/github-markdown-css/4.0.0/github-markdown.min.css" />

  <link  rel="stylesheet" href="https://lib.baomitu.com/hint.css/2.7.0/hint.min.css" />

  <link  rel="stylesheet" href="https://lib.baomitu.com/fancybox/3.5.7/jquery.fancybox.min.css" />



<!-- 主题依赖的图标库，不要自行修改 -->
<!-- Do not modify the link that theme dependent icons -->

<link rel="stylesheet" href="//at.alicdn.com/t/font_1749284_hj8rtnfg7um.css">



<link rel="stylesheet" href="//at.alicdn.com/t/font_1736178_lbnruvf0jn.css">


<link  rel="stylesheet" href="/css/main.css" />


  <link id="highlight-css" rel="stylesheet" href="/css/highlight.css" />
  
    <link id="highlight-css-dark" rel="stylesheet" href="/css/highlight-dark.css" />
  




  <script id="fluid-configs">
    var Fluid = window.Fluid || {};
    Fluid.ctx = Object.assign({}, Fluid.ctx)
    var CONFIG = {"hostname":"example.com","root":"/","version":"1.9.2","typing":{"enable":true,"typeSpeed":70,"cursorChar":"_","loop":false,"scope":[]},"anchorjs":{"enable":true,"element":"h1,h2,h3,h4,h5,h6","placement":"left","visible":"hover","icon":""},"progressbar":{"enable":true,"height_px":3,"color":"#29d","options":{"showSpinner":false,"trickleSpeed":100}},"code_language":{"enable":true,"default":"TEXT"},"copy_btn":true,"image_caption":{"enable":true},"image_zoom":{"enable":true,"img_url_replace":["",""]},"toc":{"enable":true,"placement":"right","headingSelector":"h1,h2,h3,h4,h5,h6","collapseDepth":0},"lazyload":{"enable":true,"loading_img":"/img/loading.gif","onlypost":false,"offset_factor":2},"web_analytics":{"enable":false,"follow_dnt":true,"baidu":null,"google":null,"gtag":null,"tencent":{"sid":null,"cid":null},"woyaola":null,"cnzz":null,"leancloud":{"app_id":null,"app_key":null,"server_url":null,"path":"window.location.pathname","ignore_local":false}},"search_path":"/local-search.xml"};

    if (CONFIG.web_analytics.follow_dnt) {
      var dntVal = navigator.doNotTrack || window.doNotTrack || navigator.msDoNotTrack;
      Fluid.ctx.dnt = dntVal && (dntVal.startsWith('1') || dntVal.startsWith('yes') || dntVal.startsWith('on'));
    }
  </script>
  <script  src="/js/utils.js" ></script>
  <script  src="/js/color-schema.js" ></script>
  


  
<meta name="generator" content="Hexo 6.2.0"></head>


<body>
  

  <header>
    

<div class="header-inner" style="height: 70vh;">
  <nav id="navbar" class="navbar fixed-top  navbar-expand-lg navbar-dark scrolling-navbar">
  <div class="container">
    <a class="navbar-brand" href="/">
      <strong>尤 Ni&#39;s Blog</strong>
    </a>

    <button id="navbar-toggler-btn" class="navbar-toggler" type="button" data-toggle="collapse"
            data-target="#navbarSupportedContent"
            aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
      <div class="animated-icon"><span></span><span></span><span></span></div>
    </button>

    <!-- Collapsible content -->
    <div class="collapse navbar-collapse" id="navbarSupportedContent">
      <ul class="navbar-nav ml-auto text-center">
        
          
          
          
          
            <li class="nav-item">
              <a class="nav-link" href="/">
                <i class="iconfont icon-home-fill"></i>
                首页
              </a>
            </li>
          
        
          
          
          
          
            <li class="nav-item">
              <a class="nav-link" href="/archives/">
                <i class="iconfont icon-archive-fill"></i>
                归档
              </a>
            </li>
          
        
          
          
          
          
            <li class="nav-item">
              <a class="nav-link" href="/categories/">
                <i class="iconfont icon-category-fill"></i>
                分类
              </a>
            </li>
          
        
          
          
          
          
            <li class="nav-item">
              <a class="nav-link" href="/tags/">
                <i class="iconfont icon-tags-fill"></i>
                标签
              </a>
            </li>
          
        
          
          
          
          
            <li class="nav-item">
              <a class="nav-link" href="/about/">
                <i class="iconfont icon-user-fill"></i>
                关于
              </a>
            </li>
          
        
        
          <li class="nav-item" id="search-btn">
            <a class="nav-link" target="_self" href="javascript:;" data-toggle="modal" data-target="#modalSearch" aria-label="Search">
              &nbsp;<i class="iconfont icon-search"></i>&nbsp;
            </a>
          </li>
          
        
        
          <li class="nav-item" id="color-toggle-btn">
            <a class="nav-link" target="_self" href="javascript:;" aria-label="Color Toggle">&nbsp;<i
                class="iconfont icon-dark" id="color-toggle-icon"></i>&nbsp;</a>
          </li>
        
      </ul>
    </div>
  </div>
</nav>

  

<div id="banner" class="banner" parallax=true
     style="background: url('/img/default.png') no-repeat center center; background-size: cover;">
  <div class="full-bg-img">
    <div class="mask flex-center" style="background-color: rgba(0, 0, 0, 0.3)">
      <div class="banner-text text-center fade-in-up">
        <div class="h2">
          
            <span id="subtitle" data-typed-text="Web项目实战 _ 购物系统v2.0 _ 开发记录（三）分页显示 _ 根据商品名称进行模糊查询"></span>
          
        </div>

        
          
  <div class="mt-3">
    
      <span class="post-meta mr-2">
        <i class="iconfont icon-author" aria-hidden="true"></i>
        John Doe
      </span>
    
    
      <span class="post-meta">
        <i class="iconfont icon-date-fill" aria-hidden="true"></i>
        <time datetime="2022-01-31 23:28" pubdate>
          2022年1月31日 晚上
        </time>
      </span>
    
  </div>

  <div class="mt-1">
    
      <span class="post-meta mr-2">
        <i class="iconfont icon-chart"></i>
        
          7k 字
        
      </span>
    

    
      <span class="post-meta mr-2">
        <i class="iconfont icon-clock-fill"></i>
        
        
        
          59 分钟
        
      </span>
    

    
    
  </div>


        
      </div>

      
    </div>
  </div>
</div>

</div>

  </header>

  <main>
    
      

<div class="container-fluid nopadding-x">
  <div class="row nomargin-x">
    <div class="side-col d-none d-lg-block col-lg-2">
      

    </div>

    <div class="col-lg-8 nopadding-x-md">
      <div class="container nopadding-x-md" id="board-ctn">
        <div id="board">
          <article class="post-content mx-auto">
            <!-- SEO header -->
            <h1 style="display: none">Web项目实战 _ 购物系统v2.0 _ 开发记录（三）分页显示 _ 根据商品名称进行模糊查询</h1>
            
              <p class="note note-info">
                
                  
                    本文最后更新于：1 小时前
                  
                
              </p>
            
            
              <div class="markdown-body">
                
                <h1 id="祝大家2022新年快乐"><a href="#祝大家2022新年快乐" class="headerlink" title="祝大家2022新年快乐!"></a>祝大家2022新年快乐!</h1><p>@[toc]</p>
<h1 id="历史记录"><a href="#历史记录" class="headerlink" title="历史记录"></a>历史记录</h1><hr>
<ul>
<li><p><a target="_blank" rel="noopener" href="https://blog.csdn.net/Unirithe/article/details/122722369">Web项目实战 | 购物系统v2.0 | 开发记录（一）需求分析 | 技术选型 | 系统设计 | 数据表设计 | SpringBoot、SSM、Thymeleaf、Bootstrap…</a></p>
</li>
<li><p><a target="_blank" rel="noopener" href="https://blog.csdn.net/Unirithe/article/details/122726356">Web项目实战 | 购物系统v2.0 | 开发记录（二）搭建SpringBoot+SSM框架环境 | 配置Druid+MyBatis | 基于Bootstrap实现登陆页面| 图片验证码接口</a></p>
</li>
</ul>
<h1 id="一、运行环境"><a href="#一、运行环境" class="headerlink" title="一、运行环境"></a>一、运行环境</h1><hr>
<ul>
<li>windows10</li>
<li>IDEA 2021.1 专业版</li>
<li>JDK8</li>
<li>SpringBoot2</li>
<li>Druid 1.2.5</li>
<li>Bootstrap 4.6.0</li>
<li>MySQL 8</li>
<li>Navicat 11</li>
</ul>
<h1 id="二、PagheHelper插件插件实现分页显示"><a href="#二、PagheHelper插件插件实现分页显示" class="headerlink" title="二、PagheHelper插件插件实现分页显示"></a>二、PagheHelper插件插件实现分页显示</h1><p><a target="_blank" rel="noopener" href="https://pagehelper.github.io/">PageHelper</a>插件是基于MyBatis框架实现的，使用原先的pageHelper插件需要有配置文件，而在SpringBoot项目中只要设置起步依赖，配置即用，十分的方便<br><code>pom.xml</code></p>
<figure class="highlight xml"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br></pre></td><td class="code"><pre><code class="hljs xml"><br><span class="hljs-tag">&lt;<span class="hljs-name">dependency</span>&gt;</span><br>    <span class="hljs-tag">&lt;<span class="hljs-name">groupId</span>&gt;</span>org.mybatis.spring.boot<span class="hljs-tag">&lt;/<span class="hljs-name">groupId</span>&gt;</span><br>    <span class="hljs-tag">&lt;<span class="hljs-name">artifactId</span>&gt;</span>mybatis-spring-boot-starter<span class="hljs-tag">&lt;/<span class="hljs-name">artifactId</span>&gt;</span><br>    <span class="hljs-tag">&lt;<span class="hljs-name">version</span>&gt;</span>2.2.1<span class="hljs-tag">&lt;/<span class="hljs-name">version</span>&gt;</span><br><span class="hljs-tag">&lt;/<span class="hljs-name">dependency</span>&gt;</span><br><br><span class="hljs-tag">&lt;<span class="hljs-name">dependency</span>&gt;</span><br>    <span class="hljs-tag">&lt;<span class="hljs-name">groupId</span>&gt;</span>com.github.pagehelper<span class="hljs-tag">&lt;/<span class="hljs-name">groupId</span>&gt;</span><br>    <span class="hljs-tag">&lt;<span class="hljs-name">artifactId</span>&gt;</span>pagehelper-spring-boot-starter<span class="hljs-tag">&lt;/<span class="hljs-name">artifactId</span>&gt;</span><br>    <span class="hljs-tag">&lt;<span class="hljs-name">version</span>&gt;</span>1.4.1<span class="hljs-tag">&lt;/<span class="hljs-name">version</span>&gt;</span><br><span class="hljs-tag">&lt;/<span class="hljs-name">dependency</span>&gt;</span><br></code></pre></td></tr></table></figure>

<p><img src="https://img-blog.csdnimg.cn/ebecdac8cbcc49c3a0f6039e1ebd5b0a.png" srcset="/img/loading.gif" lazyload alt="在这里插入图片描述"><br>前端代码：</p>
<figure class="highlight html"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br></pre></td><td class="code"><pre><code class="hljs html"><span class="hljs-comment">&lt;!-- 商品列表 --&gt;</span><br><span class="hljs-tag">&lt;<span class="hljs-name">div</span> <span class="hljs-attr">class</span>=<span class="hljs-string">&quot;container&quot;</span>&gt;</span><br>   <span class="hljs-tag">&lt;<span class="hljs-name">ul</span> <span class="hljs-attr">style</span>=<span class="hljs-string">&quot;list-style: none&quot;</span> <span class="hljs-attr">class</span>=<span class="hljs-string">&quot;row&quot;</span>&gt;</span><br>       <span class="hljs-comment">&lt;!--/*@thymesVar id=&quot;comInfo&quot; type=&quot;java.util.List&lt;com.uni.pojo.Commodity&gt;&quot;*/--&gt;</span><br>       <span class="hljs-tag">&lt;<span class="hljs-name">li</span> <span class="hljs-attr">th:each</span>=<span class="hljs-string">&quot;com : $&#123;comInfo&#125;&quot;</span> <span class="hljs-attr">class</span>=<span class="hljs-string">&quot;col-md-2 col-sm-4 u-card-body text-center&quot;</span>&gt;</span><br>           <span class="hljs-tag">&lt;<span class="hljs-name">img</span> <span class="hljs-attr">th:src</span>=<span class="hljs-string">&quot;$&#123;com.comImgSrc&#125;&quot;</span> <span class="hljs-attr">class</span>=<span class="hljs-string">&quot;u-card-img&quot;</span>&gt;</span><br>           <span class="hljs-tag">&lt;<span class="hljs-name">h6</span> <span class="hljs-attr">class</span>=<span class="hljs-string">&quot;u-text-sm text-danger&quot;</span>&gt;</span>￥<span class="hljs-tag">&lt;<span class="hljs-name">span</span> <span class="hljs-attr">th:text</span>=<span class="hljs-string">&quot;$&#123;com.comPrice&#125;&quot;</span>&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-name">span</span>&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-name">h6</span>&gt;</span><br>           <span class="hljs-tag">&lt;<span class="hljs-name">h6</span> <span class="hljs-attr">class</span>=<span class="hljs-string">&quot;u-text-sm&quot;</span>&gt;</span><span class="hljs-tag">&lt;<span class="hljs-name">span</span> <span class="hljs-attr">th:text</span>=<span class="hljs-string">&quot;&#x27;[&#x27; + $&#123;com.comType&#125; + &#x27;]&#x27;&quot;</span>&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-name">span</span>&gt;</span><span class="hljs-tag">&lt;<span class="hljs-name">span</span> <span class="hljs-attr">th:text</span>=<span class="hljs-string">&quot;$&#123;#strings.abbreviate(com.comName, 30)&#125;&quot;</span>&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-name">span</span>&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-name">h6</span>&gt;</span><br>       <span class="hljs-tag">&lt;/<span class="hljs-name">li</span>&gt;</span><br>   <span class="hljs-tag">&lt;/<span class="hljs-name">ul</span>&gt;</span><br><span class="hljs-tag">&lt;/<span class="hljs-name">div</span>&gt;</span><br><span class="hljs-comment">&lt;!-- 分页部分 --&gt;</span><br><span class="hljs-tag">&lt;<span class="hljs-name">h1</span> <span class="hljs-attr">th:text</span>=<span class="hljs-string">&quot;&#x27;第&#x27; + $&#123;pageInfo.pageNum&#125; + &#x27;页 共&#x27; + $&#123;pageInfo.pages&#125; + &#x27;页&#x27;&quot;</span> <span class="hljs-attr">class</span>=<span class="hljs-string">&quot;u-text-sm text-center&quot;</span>&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-name">h1</span>&gt;</span><br><span class="hljs-tag">&lt;<span class="hljs-name">nav</span> <span class="hljs-attr">aria-label</span>=<span class="hljs-string">&quot;Page navigation&quot;</span> <span class="hljs-attr">class</span>=<span class="hljs-string">&quot;u-text-sm&quot;</span>&gt;</span><br>   <span class="hljs-comment">&lt;!--/*@thymesVar id=&quot;pageInfo&quot; type=&quot;com.github.pagehelper.PageInfo&quot;*/--&gt;</span><br>       <span class="hljs-tag">&lt;<span class="hljs-name">ul</span> <span class="hljs-attr">class</span>=<span class="hljs-string">&quot;pagination justify-content-center&quot;</span>&gt;</span><br>           <span class="hljs-tag">&lt;<span class="hljs-name">li</span> <span class="hljs-attr">class</span>=<span class="hljs-string">&quot;page-item&quot;</span>&gt;</span><span class="hljs-tag">&lt;<span class="hljs-name">a</span> <span class="hljs-attr">class</span>=<span class="hljs-string">&quot;page-link&quot;</span> <span class="hljs-attr">th:href</span>=<span class="hljs-string">&quot;&#x27;/index.html/&#x27; + $&#123;pageInfo.navigateFirstPage&#125;&quot;</span>&gt;</span>首页<span class="hljs-tag">&lt;/<span class="hljs-name">a</span>&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-name">li</span>&gt;</span><br>           <span class="hljs-tag">&lt;<span class="hljs-name">li</span> <span class="hljs-attr">class</span>=<span class="hljs-string">&quot;page-item&quot;</span>&gt;</span><br>               <span class="hljs-tag">&lt;<span class="hljs-name">a</span> <span class="hljs-attr">class</span>=<span class="hljs-string">&quot;page-link&quot;</span> <span class="hljs-attr">th:href</span>=<span class="hljs-string">&quot;&#x27;/index.html/&#x27; + $&#123;pageInfo.prePage&#125;&quot;</span> <span class="hljs-attr">aria-label</span>=<span class="hljs-string">&quot;Previous&quot;</span>&gt;</span><br>                   <span class="hljs-tag">&lt;<span class="hljs-name">span</span> <span class="hljs-attr">aria-hidden</span>=<span class="hljs-string">&quot;true&quot;</span>&gt;</span><span class="hljs-symbol">&amp;laquo;</span><span class="hljs-tag">&lt;/<span class="hljs-name">span</span>&gt;</span><br>               <span class="hljs-tag">&lt;/<span class="hljs-name">a</span>&gt;</span><br>           <span class="hljs-tag">&lt;/<span class="hljs-name">li</span>&gt;</span><br>           <span class="hljs-tag">&lt;<span class="hljs-name">li</span> <span class="hljs-attr">class</span>=<span class="hljs-string">&quot;page-item&quot;</span> <span class="hljs-attr">th:each</span>=<span class="hljs-string">&quot;p : $&#123;pageInfo.navigatepageNums&#125;&quot;</span>&gt;</span><br>               <span class="hljs-tag">&lt;<span class="hljs-name">a</span> <span class="hljs-attr">th:href</span>=<span class="hljs-string">&quot;&#x27;/index.html/&#x27; + $&#123;p&#125;&quot;</span> <span class="hljs-attr">th:text</span>=<span class="hljs-string">&quot;$&#123;p&#125;&quot;</span> <span class="hljs-attr">th:class</span>=<span class="hljs-string">&quot;&#x27;page-link&#x27; + $&#123;p == pageInfo.pageNum ? &#x27; bg-info text-light&#x27; : &#x27;&#x27;&#125;&quot;</span>&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-name">a</span>&gt;</span><br>           <span class="hljs-tag">&lt;/<span class="hljs-name">li</span>&gt;</span><br>           <span class="hljs-tag">&lt;<span class="hljs-name">li</span> <span class="hljs-attr">class</span>=<span class="hljs-string">&quot;page-item&quot;</span>&gt;</span><br>               <span class="hljs-tag">&lt;<span class="hljs-name">a</span> <span class="hljs-attr">class</span>=<span class="hljs-string">&quot;page-link&quot;</span> <span class="hljs-attr">th:href</span>=<span class="hljs-string">&quot;&#x27;/index.html/&#x27; + $&#123;pageInfo.nextPage&#125;&quot;</span> <span class="hljs-attr">aria-label</span>=<span class="hljs-string">&quot;Next&quot;</span>&gt;</span><br>                   <span class="hljs-tag">&lt;<span class="hljs-name">span</span> <span class="hljs-attr">aria-hidden</span>=<span class="hljs-string">&quot;true&quot;</span>&gt;</span><span class="hljs-symbol">&amp;raquo;</span><span class="hljs-tag">&lt;/<span class="hljs-name">span</span>&gt;</span><br>               <span class="hljs-tag">&lt;/<span class="hljs-name">a</span>&gt;</span><br>           <span class="hljs-tag">&lt;/<span class="hljs-name">li</span>&gt;</span><br>           <span class="hljs-tag">&lt;<span class="hljs-name">li</span> <span class="hljs-attr">class</span>=<span class="hljs-string">&quot;page-item&quot;</span>&gt;</span><span class="hljs-tag">&lt;<span class="hljs-name">a</span> <span class="hljs-attr">class</span>=<span class="hljs-string">&quot;page-link&quot;</span> <span class="hljs-attr">th:href</span>=<span class="hljs-string">&quot;&#x27;/index.html/&#x27; + $&#123;pageInfo.navigateLastPage&#125;&quot;</span>&gt;</span>末页<span class="hljs-tag">&lt;/<span class="hljs-name">a</span>&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-name">li</span>&gt;</span><br>       <span class="hljs-tag">&lt;/<span class="hljs-name">ul</span>&gt;</span><br><span class="hljs-tag">&lt;/<span class="hljs-name">nav</span>&gt;</span><br></code></pre></td></tr></table></figure>

<p>控制层</p>
<figure class="highlight java"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br></pre></td><td class="code"><pre><code class="hljs java"><span class="hljs-meta">@GetMapping(&quot;/index.html/&#123;pageNow&#125;&quot;)</span><br>  <span class="hljs-keyword">public</span> String <span class="hljs-title function_">findAllByPage</span><span class="hljs-params">(ModelMap modelMap,</span><br><span class="hljs-params">                              <span class="hljs-meta">@PathVariable(value = &quot;pageNow&quot; , required = false)</span></span><br><span class="hljs-params">                                      Integer pageNow,</span><br><span class="hljs-params">                              <span class="hljs-meta">@RequestParam(value = &quot;pageSize&quot;, defaultValue = &quot;10&quot;)</span></span><br><span class="hljs-params">                                      Integer pageSize)</span>&#123;<br><br>      <span class="hljs-keyword">if</span>(pageNow == <span class="hljs-literal">null</span>) pageNow = <span class="hljs-keyword">new</span> <span class="hljs-title class_">Integer</span>(<span class="hljs-number">1</span>);<br>      PageHelper.startPage(pageNow, pageSize);<br>      List&lt;Commodity&gt; comInfo = commodityMapper.selectByExample(<span class="hljs-keyword">new</span> <span class="hljs-title class_">CommodityExample</span>());<br>      PageInfo&lt;Commodity&gt; pageInfo = <span class="hljs-keyword">new</span> <span class="hljs-title class_">PageInfo</span>&lt;&gt;(comInfo);<br>      <span class="hljs-comment">// 首页设置上一个页面为1，防止上一页到末页</span><br>      <span class="hljs-keyword">if</span>(pageNow == <span class="hljs-number">1</span>) pageInfo.setPrePage(<span class="hljs-number">1</span>);<br>      <span class="hljs-comment">// 末页设置最后一个页面，防止下一页到首页</span><br>      <span class="hljs-keyword">if</span>(pageInfo.getNextPage() == <span class="hljs-number">0</span>) pageInfo.setNextPage(pageInfo.getPrePage() + <span class="hljs-number">1</span>);<br><br>      modelMap.addAttribute(<span class="hljs-string">&quot;pageNow&quot;</span>, pageNow);<br>      modelMap.addAttribute(<span class="hljs-string">&quot;pageSize&quot;</span>, pageSize);<br>      modelMap.addAttribute(<span class="hljs-string">&quot;comInfo&quot;</span>, comInfo);<br>      modelMap.addAttribute(<span class="hljs-string">&quot;pageInfo&quot;</span>, pageInfo);<br>      <span class="hljs-keyword">return</span> <span class="hljs-string">&quot;index&quot;</span>;<br>  &#125;<br></code></pre></td></tr></table></figure>

<h1 id="三、根据商品名称进行模糊查询"><a href="#三、根据商品名称进行模糊查询" class="headerlink" title="三、根据商品名称进行模糊查询"></a>三、根据商品名称进行模糊查询</h1><hr>
<p>使用MyBatis逆向工程生成的Mapper接口进行查询</p>
<p><img src="https://img-blog.csdnimg.cn/af5582e39f7d433da82414e66732d85f.png" srcset="/img/loading.gif" lazyload alt="在这里插入图片描述"><br>前端页面：</p>
<figure class="highlight html"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br></pre></td><td class="code"><pre><code class="hljs html"><span class="hljs-tag">&lt;<span class="hljs-name">nav</span> <span class="hljs-attr">class</span>=<span class="hljs-string">&quot;nav input-group input-group-sm mt-3 container&quot;</span> <span class="hljs-attr">th:fragment</span>=<span class="hljs-string">&quot;search&quot;</span>&gt;</span><br>    <span class="hljs-tag">&lt;<span class="hljs-name">input</span> <span class="hljs-attr">id</span>=<span class="hljs-string">&quot;input-search&quot;</span> <span class="hljs-attr">type</span>=<span class="hljs-string">&quot;text&quot;</span> <span class="hljs-attr">class</span>=<span class="hljs-string">&quot;form-control&quot;</span> <span class="hljs-attr">placeholder</span>=<span class="hljs-string">&quot;请输入查询的商品，商品名称/种类/...&quot;</span>&gt;</span><br>    <span class="hljs-tag">&lt;<span class="hljs-name">div</span> <span class="hljs-attr">class</span>=<span class="hljs-string">&quot;input-group-append&quot;</span>&gt;</span><br>        <span class="hljs-tag">&lt;<span class="hljs-name">button</span> <span class="hljs-attr">class</span>=<span class="hljs-string">&quot;input-group-text btn btn-info&quot;</span> <span class="hljs-attr">id</span>=<span class="hljs-string">&quot;btn-search&quot;</span>&gt;</span><br>            <span class="hljs-tag">&lt;<span class="hljs-name">i</span> <span class="hljs-attr">class</span>=<span class="hljs-string">&quot;bi bi-search&quot;</span>&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-name">i</span>&gt;</span><br>        <span class="hljs-tag">&lt;/<span class="hljs-name">button</span>&gt;</span><br>    <span class="hljs-tag">&lt;/<span class="hljs-name">div</span>&gt;</span><br><span class="hljs-tag">&lt;/<span class="hljs-name">nav</span>&gt;</span><br></code></pre></td></tr></table></figure>

<p>控制层</p>
<figure class="highlight java"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br></pre></td><td class="code"><pre><code class="hljs java"><span class="hljs-meta">@GetMapping(&quot;/search.html/&#123;searchText&#125;/&#123;pageNow&#125;&quot;)</span><br><span class="hljs-keyword">public</span> String <span class="hljs-title function_">findBySome</span><span class="hljs-params">(ModelMap modelMap,</span><br><span class="hljs-params">                         <span class="hljs-meta">@PathVariable</span> String searchText,</span><br><span class="hljs-params">                         <span class="hljs-meta">@PathVariable(value = &quot;pageNow&quot; , required = false)</span></span><br><span class="hljs-params">                                     Integer pageNow,</span><br><span class="hljs-params">                         <span class="hljs-meta">@RequestParam(value = &quot;pageSize&quot;, defaultValue = &quot;10&quot;)</span></span><br><span class="hljs-params">                                     Integer pageSize)</span>&#123;<br>    <span class="hljs-keyword">if</span>(pageNow == <span class="hljs-literal">null</span>) pageNow = <span class="hljs-keyword">new</span> <span class="hljs-title class_">Integer</span>(<span class="hljs-number">1</span>);<br>    PageHelper.startPage(pageNow, pageSize);<br>    <span class="hljs-type">CommodityExample</span> <span class="hljs-variable">e1</span> <span class="hljs-operator">=</span> <span class="hljs-keyword">new</span> <span class="hljs-title class_">CommodityExample</span>() &#123;&#123;<br>        createCriteria().andComNameLike(<span class="hljs-string">&quot;%&quot;</span> + searchText + <span class="hljs-string">&quot;%&quot;</span>);<br>    &#125;&#125;;<br>    List&lt;Commodity&gt; comInfo = commodityMapper.selectByExample(e1);<br>    PageInfo&lt;Commodity&gt; pageInfo = <span class="hljs-keyword">new</span> <span class="hljs-title class_">PageInfo</span>&lt;&gt;(comInfo);<br>    <span class="hljs-comment">// 首页设置上一个页面为1，防止上一页到末页</span><br>    <span class="hljs-keyword">if</span>(pageNow == <span class="hljs-number">1</span>) pageInfo.setPrePage(<span class="hljs-number">1</span>);<br>    <span class="hljs-comment">// 末页设置最后一个页面，防止下一页到首页</span><br>    <span class="hljs-keyword">if</span>(pageInfo.getNextPage() == <span class="hljs-number">0</span>) pageInfo.setNextPage(pageInfo.getPrePage() + <span class="hljs-number">1</span>);<br><br>    modelMap.addAttribute(<span class="hljs-string">&quot;pageNow&quot;</span>, pageNow);<br>    modelMap.addAttribute(<span class="hljs-string">&quot;pageSize&quot;</span>, pageSize);<br>    modelMap.addAttribute(<span class="hljs-string">&quot;comInfo&quot;</span>, comInfo);<br>    modelMap.addAttribute(<span class="hljs-string">&quot;pageInfo&quot;</span>, pageInfo);<br>    System.out.println(<span class="hljs-string">&quot;ok!&quot;</span> + searchText);<br>    <span class="hljs-keyword">return</span> searchText == <span class="hljs-literal">null</span> ? <span class="hljs-string">&quot;/index.html/1&quot;</span> : <span class="hljs-string">&quot;index&quot;</span>;<br>&#125;<br></code></pre></td></tr></table></figure>

<h1 id="四、Thymeleaf引擎使用"><a href="#四、Thymeleaf引擎使用" class="headerlink" title="四、Thymeleaf引擎使用"></a>四、Thymeleaf引擎使用</h1><hr>
<p>基本语法：</p>
<ul>
<li><code>th:fragment=&quot;名称&quot;</code>  创建页面</li>
<li><code>th:replace=&quot;页面路径::页面部分&quot;</code> 替换指定的页面</li>
</ul>
<p>使用Thymeleaf渲染页面十分方便，能把不同的代码分为不同模块，如下图所示：<br><img src="https://img-blog.csdnimg.cn/27e84fd0fee744f59c63c82d96251f50.png" srcset="/img/loading.gif" lazyload alt="在这里插入图片描述"><br>其中，除了 link 、script 标签借助 <strong>th:href、th:src</strong> 引入了pom.xml依赖里的jar包和静态资源以外，能使用其他的元素内标签借助th:replace进行替换，替换的内容就是在其他支持thymeleft的HTML页面的一部分，比如<code>search.html</code>的内容就是之前实现模糊查询的部分，如下图所示：<br><img src="https://img-blog.csdnimg.cn/7c53bd82d0374c3fafaf43f060470793.png" srcset="/img/loading.gif" lazyload alt="在这里插入图片描述"><br><code>search.html</code> 里声明当前标签的为 <code>th:fragment=&quot;search&quot;</code></p>
<h1 id="五、BUG-amp-DeBug"><a href="#五、BUG-amp-DeBug" class="headerlink" title="五、BUG &amp; DeBug"></a>五、BUG &amp; DeBug</h1><hr>
<h2 id="5-1-iframe指定其他页面，显示找不到路径"><a href="#5-1-iframe指定其他页面，显示找不到路径" class="headerlink" title="5.1 iframe指定其他页面，显示找不到路径"></a>5.1 iframe指定其他页面，显示找不到路径</h2><p><strong>BUG：</strong><br><img src="https://img-blog.csdnimg.cn/6909ccec8fb049f58b8b3114db09c6c7.png" srcset="/img/loading.gif" lazyload alt="在这里插入图片描述"></p>
<p><strong>解决：</strong> 在使用th:标签时指定路径，需要加上@{}符号，如：</p>
<figure class="highlight html"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><code class="hljs html"><span class="hljs-tag">&lt;<span class="hljs-name">iframe</span> <span class="hljs-attr">th:src</span>=<span class="hljs-string">&quot;@&#123;/templates/code.html&#125; ... /&gt;&quot;</span></span><br></code></pre></td></tr></table></figure>
<h2 id="5-2-JS函数修改全局变量的形参没有作用"><a href="#5-2-JS函数修改全局变量的形参没有作用" class="headerlink" title="5.2 JS函数修改全局变量的形参没有作用"></a>5.2 JS函数修改全局变量的形参没有作用</h2><p><strong>解决：</strong> 在JS函数最后 return 修改的全局变量，传参的同时赋一下值，如：</p>
<figure class="highlight javascript"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><code class="hljs javascript">int a = <span class="hljs-number">1</span><br><span class="hljs-keyword">function</span> <span class="hljs-title function_">add</span>(<span class="hljs-params">a</span>)&#123;<br>	<span class="hljs-keyword">return</span> ++a;<br>&#125;<br>a = <span class="hljs-title function_">add</span>(a)<br></code></pre></td></tr></table></figure>

<h2 id="5-3-Thymeleaf页面获取不到session域的值"><a href="#5-3-Thymeleaf页面获取不到session域的值" class="headerlink" title="5.3 Thymeleaf页面获取不到session域的值"></a>5.3 Thymeleaf页面获取不到session域的值</h2><p><strong>解决：</strong> 通过session域直接获取用户，然后直接获取属性值</p>
<p>实体类</p>
<figure class="highlight java"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><code class="hljs java"><span class="hljs-keyword">private</span> <span class="hljs-keyword">class</span> <span class="hljs-title class_">User</span>&#123;<br>	<span class="hljs-keyword">private</span> String userCode;<br>	<span class="hljs-keyword">private</span> String passwrod;<br>&#125;<br></code></pre></td></tr></table></figure>
<p>控制层</p>
<figure class="highlight java"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br></pre></td><td class="code"><pre><code class="hljs java"><span class="hljs-meta">@Controller</span><br><span class="hljs-keyword">private</span> <span class="hljs-keyword">class</span> <span class="hljs-title class_">UserAction</span>&#123;<br>	<span class="hljs-meta">@PostMapping</span><br>	<span class="hljs-keyword">public</span> String <span class="hljs-title function_">login</span><span class="hljs-params">(User user, HttpSession session)</span>&#123;<br>		<span class="hljs-comment">// ...登陆的业务处理逻辑</span><br>		session.setAttribute(<span class="hljs-string">&quot;userInfo&quot;</span>, user);<br>		<span class="hljs-keyword">return</span> <span class="hljs-string">&quot;index&quot;</span>;<br>	&#125;<br>&#125;<br></code></pre></td></tr></table></figure>
<p>前端页面</p>
<figure class="highlight html"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><code class="hljs html"><span class="hljs-tag">&lt;<span class="hljs-name">span</span> <span class="hljs-attr">th:text</span>=<span class="hljs-string">&quot;$&#123;session.userInfo.userCode&#125;&quot;</span>/&gt;</span><br></code></pre></td></tr></table></figure>

                
              </div>
            
            <hr/>
            <div>
              <div class="post-metas my-3">
  
    <div class="post-meta mr-3 d-flex align-items-center">
      <i class="iconfont icon-category"></i>
      

<span class="category-chains">
  
  
    
      <span class="category-chain">
        
  <a href="/categories/%E9%A1%B9%E7%9B%AE%E5%AE%9E%E6%88%98-%E8%B4%AD%E7%89%A9%E7%B3%BB%E7%BB%9Fv2-0/" class="category-chain-item">项目实战:购物系统v2.0</a>
  
  

      </span>
    
  
</span>

    </div>
  
  
    <div class="post-meta">
      <i class="iconfont icon-tags"></i>
      
        <a href="/tags/JavaWeb/">#JavaWeb</a>
      
        <a href="/tags/%E9%A1%B9%E7%9B%AE%E5%AE%9E%E6%88%98-%E8%B4%AD%E7%89%A9%E7%B3%BB%E7%BB%9Fv2-0/">#项目实战:购物系统v2.0</a>
      
    </div>
  
</div>


              
  

  <div class="license-box my-3">
    <div class="license-title">
      <div>Web项目实战 _ 购物系统v2.0 _ 开发记录（三）分页显示 _ 根据商品名称进行模糊查询</div>
      <div>http://example.com/2022/01/31/Web项目实战 _ 购物系统v2.0 _ 开发记录（三）分页显示 _ 根据商品名称进行模糊查询/</div>
    </div>
    <div class="license-meta">
      
        <div class="license-meta-item">
          <div>作者</div>
          <div>John Doe</div>
        </div>
      
      
        <div class="license-meta-item license-meta-date">
          <div>发布于</div>
          <div>2022年1月31日</div>
        </div>
      
      
      <div class="license-meta-item">
        <div>许可协议</div>
        <div>
          
            
            
              <a target="_blank" href="https://creativecommons.org/licenses/by/4.0/">
              <span class="hint--top hint--rounded" aria-label="BY - 署名">
                <i class="iconfont icon-by"></i>
              </span>
              </a>
            
          
        </div>
      </div>
    </div>
    <div class="license-icon iconfont"></div>
  </div>



              
                <div class="post-prevnext my-3">
                  <article class="post-prev col-6">
                    
                    
                      <a href="/2022/02/01/%E6%9C%88%E5%BA%A6%E6%80%BB%E7%BB%93%20_%202022%E5%B9%B401%E6%9C%88%20_%20%E5%A4%A7%E4%B8%89%E6%9C%9F%E6%9C%AB%E8%80%83%E8%AF%95%E6%8F%90%E5%89%8D%20_%20%E5%87%86%E5%A4%87%E6%9C%9F%E6%9C%AB%E8%80%83%E6%80%BB%E7%BB%93%20_%20%E5%81%87%E6%9C%9F%E5%AD%A6%E4%B9%A0%E8%AE%B0%E5%BD%95%E6%80%BB%E7%BB%93%20_%20%E6%9C%88%E5%BA%A6%E6%94%B6%E8%8E%B7%E6%80%BB%E7%BB%93%E3%80%81%E5%BF%83%E5%BE%97%E4%B8%8E%E5%B1%95%E6%9C%9B/" title="月度总结 _ 2022年01月 _ 大三期末考试提前 _ 准备期末考总结 _ 假期学习记录总结 _ 月度收获总结、心得与展望">
                        <i class="iconfont icon-arrowleft"></i>
                        <span class="hidden-mobile">月度总结 _ 2022年01月 _ 大三期末考试提前 _ 准备期末考总结 _ 假期学习记录总结 _ 月度收获总结、心得与展望</span>
                        <span class="visible-mobile">上一篇</span>
                      </a>
                    
                  </article>
                  <article class="post-next col-6">
                    
                    
                      <a href="/2022/01/29/Web%E9%A1%B9%E7%9B%AE%E5%AE%9E%E6%88%98%20_%20%E8%B4%AD%E7%89%A9%E7%B3%BB%E7%BB%9Fv2.0%20_%20%E5%BC%80%E5%8F%91%E8%AE%B0%E5%BD%95%EF%BC%88%E4%BA%8C%EF%BC%89%E6%90%AD%E5%BB%BASpringBoot+SSM%E6%A1%86%E6%9E%B6%E7%8E%AF%E5%A2%83%20_%20%E9%85%8D%E7%BD%AEDruid+MyBatis%20_%20%E5%9F%BA%E4%BA%8EBootstrap%E5%AE%9E%E7%8E%B0%E7%99%BB%E9%99%86%E9%A1%B5%E9%9D%A2_%20%E5%9B%BE%E7%89%87%E9%AA%8C%E8%AF%81%E7%A0%81%E6%8E%A5%E5%8F%A3/" title="Web项目实战 _ 购物系统v2.0 _ 开发记录（二）搭建SpringBoot+SSM框架环境 _ 配置Druid+MyBatis _ 基于Bootstrap实现登陆页面_ 图片验证码接口">
                        <span class="hidden-mobile">Web项目实战 _ 购物系统v2.0 _ 开发记录（二）搭建SpringBoot+SSM框架环境 _ 配置Druid+MyBatis _ 基于Bootstrap实现登陆页面_ 图片验证码接口</span>
                        <span class="visible-mobile">下一篇</span>
                        <i class="iconfont icon-arrowright"></i>
                      </a>
                    
                  </article>
                </div>
              
            </div>

            
          </article>
        </div>
      </div>
    </div>

    <div class="side-col d-none d-lg-block col-lg-2">
      
  <aside class="sidebar" style="margin-left: -1rem">
    <div id="toc">
  <p class="toc-header"><i class="iconfont icon-list"></i>&nbsp;目录</p>
  <div class="toc-body" id="toc-body"></div>
</div>



  </aside>


    </div>
  </div>
</div>





  



  



  



  



  







    

    
      <a id="scroll-top-button" aria-label="TOP" href="#" role="button">
        <i class="iconfont icon-arrowup" aria-hidden="true"></i>
      </a>
    

    
      <div class="modal fade" id="modalSearch" tabindex="-1" role="dialog" aria-labelledby="ModalLabel"
     aria-hidden="true">
  <div class="modal-dialog modal-dialog-scrollable modal-lg" role="document">
    <div class="modal-content">
      <div class="modal-header text-center">
        <h4 class="modal-title w-100 font-weight-bold">搜索</h4>
        <button type="button" id="local-search-close" class="close" data-dismiss="modal" aria-label="Close">
          <span aria-hidden="true">&times;</span>
        </button>
      </div>
      <div class="modal-body mx-3">
        <div class="md-form mb-5">
          <input type="text" id="local-search-input" class="form-control validate">
          <label data-error="x" data-success="v" for="local-search-input">关键词</label>
        </div>
        <div class="list-group" id="local-search-result"></div>
      </div>
    </div>
  </div>
</div>

    

    
  </main>

  <footer>
    <div class="footer-inner">
  
    <div class="footer-content">
       <a href="https://hexo.io" target="_blank" rel="nofollow noopener"><span>Hexo</span></a> <i class="iconfont icon-love"></i> <a href="https://github.com/fluid-dev/hexo-theme-fluid" target="_blank" rel="nofollow noopener"><span>Fluid</span></a> 
    </div>
  
  
  
  
</div>

  </footer>

  <!-- Scripts -->
  
  <script  src="https://lib.baomitu.com/nprogress/0.2.0/nprogress.min.js" ></script>
  <link  rel="stylesheet" href="https://lib.baomitu.com/nprogress/0.2.0/nprogress.min.css" />

  <script>
    NProgress.configure({"showSpinner":false,"trickleSpeed":100})
    NProgress.start()
    window.addEventListener('load', function() {
      NProgress.done();
    })
  </script>


<script  src="https://lib.baomitu.com/jquery/3.6.0/jquery.min.js" ></script>
<script  src="https://lib.baomitu.com/twitter-bootstrap/4.6.1/js/bootstrap.min.js" ></script>
<script  src="/js/events.js" ></script>
<script  src="/js/plugins.js" ></script>


  <script  src="https://lib.baomitu.com/typed.js/2.0.12/typed.min.js" ></script>
  <script>
    (function (window, document) {
      var typing = Fluid.plugins.typing;
      var subtitle = document.getElementById('subtitle');
      if (!subtitle || !typing) {
        return;
      }
      var text = subtitle.getAttribute('data-typed-text');
      
        typing(text);
      
    })(window, document);
  </script>




  
    <script  src="/js/img-lazyload.js" ></script>
  




  
<script>
  Fluid.utils.createScript('https://lib.baomitu.com/tocbot/4.18.2/tocbot.min.js', function() {
    var toc = jQuery('#toc');
    if (toc.length === 0 || !window.tocbot) { return; }
    var boardCtn = jQuery('#board-ctn');
    var boardTop = boardCtn.offset().top;

    window.tocbot.init({
      tocSelector     : '#toc-body',
      contentSelector : '.markdown-body',
      headingSelector : CONFIG.toc.headingSelector || 'h1,h2,h3,h4,h5,h6',
      linkClass       : 'tocbot-link',
      activeLinkClass : 'tocbot-active-link',
      listClass       : 'tocbot-list',
      isCollapsedClass: 'tocbot-is-collapsed',
      collapsibleClass: 'tocbot-is-collapsible',
      collapseDepth   : CONFIG.toc.collapseDepth || 0,
      scrollSmooth    : true,
      headingsOffset  : -boardTop
    });
    if (toc.find('.toc-list-item').length > 0) {
      toc.css('visibility', 'visible');
    }
  });
</script>


  <script src=https://lib.baomitu.com/clipboard.js/2.0.10/clipboard.min.js></script>

  <script>Fluid.plugins.codeWidget();</script>


  
<script>
  Fluid.utils.createScript('https://lib.baomitu.com/anchor-js/4.3.1/anchor.min.js', function() {
    window.anchors.options = {
      placement: CONFIG.anchorjs.placement,
      visible  : CONFIG.anchorjs.visible
    };
    if (CONFIG.anchorjs.icon) {
      window.anchors.options.icon = CONFIG.anchorjs.icon;
    }
    var el = (CONFIG.anchorjs.element || 'h1,h2,h3,h4,h5,h6').split(',');
    var res = [];
    for (var item of el) {
      res.push('.markdown-body > ' + item.trim());
    }
    if (CONFIG.anchorjs.placement === 'left') {
      window.anchors.options.class = 'anchorjs-link-left';
    }
    window.anchors.add(res.join(', '));
  });
</script>


  
<script>
  Fluid.utils.createScript('https://lib.baomitu.com/fancybox/3.5.7/jquery.fancybox.min.js', function() {
    Fluid.plugins.fancyBox();
  });
</script>


  <script>Fluid.plugins.imageCaption();</script>

  <script  src="/js/local-search.js" ></script>





<!-- 主题的启动项，将它保持在最底部 -->
<!-- the boot of the theme, keep it at the bottom -->
<script  src="/js/boot.js" ></script>


  

  <noscript>
    <div class="noscript-warning">博客在允许 JavaScript 运行的环境下浏览效果更佳</div>
  </noscript>
</body>
</html>
